Skip to content

drm: re-send ctm blob on modeset#256

Merged
vaxerski merged 1 commit into
hyprwm:mainfrom
wongma7:ctmmodeset
Mar 13, 2026
Merged

drm: re-send ctm blob on modeset#256
vaxerski merged 1 commit into
hyprwm:mainfrom
wongma7:ctmmodeset

Conversation

@wongma7

@wongma7 wongma7 commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

like hdr #250, ctm needs to be re-sent on modeset, otherwise COMMITTED stays true and it's not sent after e.g. suspend or hyprctl dispatch dpms off.
Specifically this is observed for hyprsunset users like so hyprwm/hyprsunset#65:

hyprsunset -t 2500 # ctm set
hyprctl dispatch dpms off # hypridle or something turns off monitor
hyprctl dispatch dpms on # user is blinded

(Unlike hdr, have to make sure ctm has value otherwise monitor gets weird colors)

tested with and without hyprsunset running

@wongma7 wongma7 marked this pull request as draft March 8, 2026 10:50
@wongma7 wongma7 marked this pull request as ready for review March 8, 2026 11:11
@vaxerski vaxerski merged commit 43f10d2 into hyprwm:main Mar 13, 2026
1 check passed
umbrageodotus pushed a commit to umbrageodotus/aquamarine that referenced this pull request Mar 14, 2026
vaxerski pushed a commit that referenced this pull request May 10, 2026
A previous compositor (kwin etc.) can leave HDR, gamma, degamma and CTM
properties set on a connector when it exits. Aquamarine only re-emitted
these on user commits, so anything we don't actively manage stayed at
the previous compositor's value, manifesting as washed-out colors or
shifted saturation when starting Hyprland after kwin.

HDR (#250) and CTM-with-non-identity (#256) were already covered. Extend
the modeset path to also:

- re-send gamma_lut/degamma_lut on modeset; an empty STATE.gammaLut
  produces a zero blob, which clears the kernel state. only ride this
  path when the prop actually exists, otherwise we'd log a spurious
  "no gamma_lut prop" error on every modeset for connectors without
  programmable gamma.
- re-send CTM unconditionally on modeset, identity included, so the
  kernel always replaces a stale matrix with our current one. the blob
  builder produces a real identity matrix when STATE.ctm == Mat3x3(),
  so we never send blob_id=0 (which #256 documented as problematic).

Fixes #127.

Co-authored-by: j4kuuu <j4kuuu>
@UncleJ4ck UncleJ4ck mentioned this pull request May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants